package com.woniu.outlet.client;

import com.woniu.inlet.vo.ConfirmCurrentSellOrder;
import com.woniu.inlet.vo.ConfirmSellOrder;
import com.woniu.inlet.vo.FixedInputBuyOrder;
import com.woniu.inlet.vo.PayToOrderVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@Component
@FeignClient(value = "finance-order")
public interface UpdateOrderStatus {

    /**
     * 修改订单状态的方法
     * @param orderId 订单id
     * @param buyCost 手续费
     * @param buyShare 份额
     * @return
     */
    @GetMapping("/order/updateStatus0To1")
    public Object updateStatus0To1(@RequestParam("orderId") Long orderId,
                                   @RequestParam("buyCost") String buyCost,
                                   @RequestParam("buyShare") Double buyShare);


    @PostMapping("/order/fundOrGold/buy")
    public Object buyFundOrGold(@RequestBody PayToOrderVo fo);

    @PostMapping("/order/fixedOrCurrent/buy")
    public Object buyFixedOrCurrent(@RequestBody PayToOrderVo fo);

    @PostMapping("/order/revocationDate")
    public void revocationDate(@RequestParam("sId") String sId,
                               @RequestParam("revocationDate") String revocationDate);

    /**
     * 卖出成功后通知order模块
     * 普通卖出
     * @param confirmSellOrder
     */
    @PostMapping("/order/confirmSellOrder")
    public void confirmSellOrder(@RequestBody ConfirmSellOrder confirmSellOrder);

    /**
     * 确认活期的卖出
     * @param currentSellOrder
     */
    @PostMapping("/order/confirmCurrentSellOrder")
    public void confirmCurrentSellOrder(@RequestBody ConfirmCurrentSellOrder currentSellOrder);

    /**
     * 定投买入的确认，成功则revocationTime有日期，失败则revocationTime为0
     * @param fixedInputBuyOrder
     */
    @PostMapping("/order/fixedInputBuyOrder")
    public void fixedInputBuyOrder(@RequestBody FixedInputBuyOrder fixedInputBuyOrder);

}
